#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
# Copyright (c) 2022 Argo Technologie East
#

COMPATFILES = \
    compat-2018 \
    compat-2019 \
    compat-2020 \
    compat-2021 \
    freebsd-11.0 \
    freebsd-11.2 \
    freebsd-11.3 \
    freenas-9.10.2 \
    grub2 \
    openzfs-2.0-freebsd \
    openzfs-2.0-linux \
    openzfs-2.1-freebsd \
    openzfs-2.1-linux \
    openzfsonosx-1.7.0 \
    openzfsonosx-1.8.1 \
    openzfsonosx-1.9.3 \
    zol-0.6.1 \
    zol-0.6.4 \
    zol-0.6.5 \
    zol-0.7 \
    zol-0.8

ZPOOLCOMPATLINKS = \
        "compat-2018            2018" \
        "compat-2019            2019" \
        "compat-2020            2020" \
        "compat-2021            2021" \
        "freebsd-11.0           freebsd-11.1" \
        "freebsd-11.0           freenas-11.0" \
        "freebsd-11.2           freenas-11.2" \
        "freebsd-11.3           freebsd-11.4" \
        "freebsd-11.3           freebsd-12.0" \
        "freebsd-11.3           freebsd-12.1" \
        "freebsd-11.3           freebsd-12.2" \
        "freebsd-11.3           freenas-11.3" \
        "freenas-11.0           freenas-11.1" \
        "openzfsonosx-1.9.3     openzfsonosx-1.9.4" \
        "openzfs-2.0-freebsd    truenas-12.0"

ZPOOLCOMPATDIR = $(ROOT)/usr/share/zfs/compatibility.d

include ../../Makefile.cmd

ZPOOLCOMPATFILES= $(COMPATFILES:%=$(ZPOOLCOMPATDIR)/%)

$(ZPOOLCOMPATDIR) :=  FILEMODE= 755
$(ZPOOLCOMPATFILES) := FILEMODE= 0644

.KEEP_STATE:

install: $(ZPOOLCOMPATDIR) $(ZPOOLCOMPATFILES)

$(ZPOOLCOMPATDIR):
	$(INS.dir)

$(ZPOOLCOMPATDIR)/%:%
	$(INS.file)

clean:
	$(RM) $(ZPOOLCOMPATFILES)

lint:

#clobber: clean

FRC:
